package cn.jly.spring.boot.cloud.config;

import cn.jly.spring.boot.cloud.interceptor.LogHandlerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author lanyangji
 * @description mvc配置
 * @date 2020/11/23 下午 8:25
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        final InterceptorRegistration interceptorRegistration =
                registry.addInterceptor(new LogHandlerInterceptor());
        interceptorRegistration.addPathPatterns("/**");
    }
}
